<template>
	<div class="page has-navbar" v-nav="{title: '新增员工', showBackButton: true}">
		<div class="page-content padding-top">
			<item class="y-item">
				<span class="item-title">姓名</span>
				<input type="text" class="y-item-input" name="" v-model="userName" placeholder="请输入姓名" required>
			</item>
			<item class="y-item" style="margin-bottom:50px;">
				<span class="item-title">手机号</span>
				<input type="tel" class="y-item-input" name="" v-model="userMobile" placeholder="请输入手机号" required>
			</item>
			<div class="outbtn" ><md-button class="button button-assertive button-block" @click.native="addStaff">保存</md-button></div>
			
		</div>
	</div>
	</template>
	
<script>
export default {
	data () {
		return {
			userName:'',
			userMobile:''
		}
	},
	methods:{
		addStaff() {
			var _this = this;
			axios.get(baseUrl+'/controller/insertUser',{params:{
					userName:this.userName,
					userMobile:this.userMobile,
					marketId:sess.get('userSession').marketId,
					shopId:sess.get('userSession').shopId,
					userType:41
				}
			})
			.then(function(res){
				$router.back('/staff')
			})

		}
	}
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

</style>
